#include "app_buffer.h"
#include "log/log.h"

int main(int argc, char *argv[])
{
    Buffer_t *buffer = app_buffer_init(15);

    app_buffer_write(buffer, "hello", 5);
    app_buffer_write(buffer, "world", 5);

    char data_buf1[10];
    int len1 = app_buffer_read(buffer, data_buf1,10);
    log_debug("read data1: %.*s , len1: %d", len1,data_buf1 , len1);

    char data_buf2[10];
    int len2 = app_buffer_read(buffer, data_buf2,10);
    log_debug("read data: %.*s , len: %d", len2,data_buf2 , len2);

    app_buffer_destroy(buffer);

    return 0;
}